	var mySwiper = new Swiper('.swiper-container', {
		autoplay: 3000,//可选选项，自动滑动
		loop:true
	})
//	var indexTip = new Tip();
//	indexTip.renderUI({
////		skin:"",
//		content:"<p>你的倾销币30个</p><p>查看需要消耗XX个</p>",
//		bottom:'<button class="btn">确定查看</button><button class="btn close">取消</button>',
//		showWay:'confirm',
//	})
	$(".tips").find(".close").click(function(){
		$(".tips").css({
					opacity:0,
					visibility:"hidden"
				})
	})
	//show
	$(".show").click(function(e){
		$(".window").fadeIn();
		e.stopPropagation();
		return false;
	})
	//上拉加载更多
//	$(document).on("swipeup",function(){
//		if($(document).height()<=$(window).height()){
//		}
//	})



//上拉刷新
//	var buttom = false;
//	var flag = false;
//	var scrollHandler = function(){
//		myScroll = $(window).scrollTop();
//		winH = $(window).height();
// 	 	if( ($('body').height() - myScroll) <= winH &&!buttom){
// 	 		console.log("到底了");
//			buttom= true;
//			more();
//		}
//}
//	function more(){
//				$(document).off("swipeup");
//				console.log("我要插了");
//				flag = true
//				$(document).on("swipeup",function(){
//				if(flag){
//					var i = '<div class="product">'+
//						'<a href="detail.html">'+
//						'<div class="block">'+
//							'<img class="item_img" data-src="../img/4dd44390f603738d3a5b4f1cb21bb051f919ecd5.jpg" data-load="false"/>'+
//							'<div class="info">'+
//								'<p class="name">我是物品'+($(".product").length+1)+'</p>'+
//								'<p class="clearfloat"><span>零售价：<span class="price">111</span></span>&nbsp;&nbsp;<span class="floatRight">批发价：<span class="price">111</span></span></p>'+
//								'<p class="clearfloat"><span>工厂价：<span class="price">111</span></span>&nbsp;&nbsp;<span class="qingxiao floatRight">倾销：<span	class=""><button class="show">显示更多</button></span></span></p>'+
//							'</div>'+
//						'</div>'+
//						'</a>'+
//					'</div>'
//						$(".item_list").append(i);
////						alert("我插入了"+$(".product").length);
//						buttom=false;
//						flag=false;
//					}
//				})
//	}
//window.onscroll = function(){
//	lazyLoad($(".item_img"));
		var buttom = false;
$(document).on("swipeup",function(){
		var winH =$(window).height();
		var myScroll = $(window).scrollTop();
		if(($(document).height()<= winH||($('body').height() - myScroll) <= winH )&&!buttom){
			console.log("到底了");
			buttom=true;
			$(".slideToMore").hide();
			$(".loading").show();
			setTimeout(function(){
				more()
			},1000)
		}
})

function more(){
	var i = '<div class="product">'+
						'<a href="detail.html">'+
						'<div class="block">'+
							'<img class="item_img" data-src="../img/4dd44390f603738d3a5b4f1cb21bb051f919ecd5.jpg" data-load="false"/>'+
							'<div class="info">'+
								'<p class="name">我是物品'+($(".product").length+1)+'</p>'+
								'<p class="clearfloat"><span>零售价：<span class="price">111</span></span>&nbsp;&nbsp;<span class="floatRight">批发价：<span class="price">111</span></span></p>'+
								'<p class="clearfloat"><span>工厂价：<span class="price">111</span></span>&nbsp;&nbsp;<span class="qingxiao floatRight">倾销：<span	class=""><button class="show">显示更多</button></span></span></p>'+
							'</div>'+
						'</div>'+
						'</a>'+
					'</div>'
						$(".item_list").append(i);
//						alert("我插入了"+$(".product").length);
						buttom=false;
						$(".slideToMore").show();
						$(".loading").hide();
	
}
window.onscroll = function(){
	lazyLoad($(".lazy[data-load='false']"));
}